package com.atguigu.spzx.product.mapper;

import com.atguigu.spzx.product.entity.ProductDetails;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 * 商品sku属性表 Mapper 接口
 * </p>
 *
 * @author flyduck
 * @since 2023-11-04
 */
public interface ProductDetailsMapper extends BaseMapper<ProductDetails> {

    /**
     * 根据productId查询ProductDetails信息
     * @param productId
     * @return
     */
    default ProductDetails getProductDetailsByProductId(Long productId){
        QueryWrapper<ProductDetails> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("product_id", productId);
        return this.selectOne(queryWrapper);
    }

}
